<?php

if (isset($sidebar))
{
	$pages['administration']['site_configuration'] = 'admin_config.php';
	return;
}

include '../includes/general.init.php';
include 'admin.init.php';

$tpl->heading = 'Site Configuration';

if (isset($_POST['submit']))
{
	
	$tpl->message = null;
	unset($_POST['submit']);
	
	foreach ($_POST as $key => $value)
	{
		if(set::update($key, $value) == true)
		{
			$key = str_replace('_', ' ', $key);
			$key = ucwords($key);
			$tpl->message .= $key . ' was updated. <br />' . nn;
		}
	}
	
	$tpl->message .= 'Click <a href="">here</a> to refresh the page.';
	
}

$tpl->display('gen_header.php');
$tpl->display('page_config.php');
$tpl->display('gen_footer.php');

session::clear_old();